package com.sima.java;

import com.sima.java.abstractfactory.AbstractProvider;
import com.sima.java.abstractfactory.AbstractSendMailFactory;
import com.sima.java.abstractfactory.Provider;
import com.sima.java.abstractfactory.SendMailFactory;
import com.sima.java.factorymethod.SendFactory;
import com.sima.java.factorymethod.SendFactoryMore;
import com.sima.java.factorymethod.SendFactoryMoreStatic;
import com.sima.java.factorymethod.Sender;

public class App
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
        /* 普通工厂
        SendFactory sendFactory = new SendFactory();
        Sender sender = sendFactory.produce("mail");
        sender.send();
        sender = sendFactory.produce("sms");
        sender.send();
        */
        /*多工厂
        SendFactoryMore sendFactoryMore = new SendFactoryMore();
        Sender sender = sendFactoryMore.produceMail();
        sender.send();
        sender = sendFactoryMore.produceMsm();
        sender.send();
        */
        /*
        Sender sender = SendFactoryMoreStatic.produceMail();
        sender.send();
        sender = SendFactoryMoreStatic.produceMsm();
        sender.send();
        */
//        Provider provider = new SendMailFactory();
//        com.sima.java.abstractfactory.Sender sender = provider.produce();
//        sender.send();
        AbstractProvider abstractProvider = new AbstractSendMailFactory();
        com.sima.java.abstractfactory.Sender sender = abstractProvider.abstractProduce();
        sender.send();

    }
}
